import zhifu from 'tool/zhifu.js'
import apis from 'tool/requestModel.js'
export default function orderFrom(product_id) {
	let optin_id = tt.getStorageSync('option_id')
	return new Promise((resolve, reject) => {
		zhifu({
				app_uid: '123456',
				openid: optin_id,
				product_id: product_id
			})
			.then(resp => {
				apis.isZhifu(resp)
					.then(res => {
						if (res.data.code == 201) {
							reject({
								code: 201,
								msg: '支付完成后才可查询结果哦'
							})
						} else {
							resolve()
						}
					})
			})
	})
}
